package com.wiley.loginPO;

import java.net.MalformedURLException;

import org.openqa.selenium.By;

import com.wiley.publicMethod.BasePage;
import com.wiley.publicMethod.LoggerControler;

import io.appium.java_client.android.AndroidDriver;

public class RegisterPage extends BasePage {

	/**
	 * 页面元素
	 */
	//我的
	public static final By mine_item_loc = By.id(BaseId + "mine_item");
	
	//点击登录按钮
	public static final By login_tv_loc = By.id(BaseId + "login_tv");

	public static final By reg_tv_loc = By.id(BaseId + "reg_tv");
	
	public static final By phone_number_loc = By.id(BaseId + "phone_number");

	
	/**
	 * 操作方法
	 */
	//点击我的
	public void clickMineItem(){
		this.clickEle(mine_item_loc);
	}

	//登录按钮
	public void clickLoginButton(){
		this.clickEle(login_tv_loc);
	}
	
	public void clickRegisterButton(){
		this.clickEle(reg_tv_loc);
		//System.out.println(this.findEle(phone_number_loc).getText());
		System.out.println(this.findEle(phone_number_loc).getAttribute("text"));
	}
	
	public void getName(){
		System.out.println(this.findEle(By.name("账号:")).getText());
		System.out.println(this.findEle(By.name("账号:")).getAttribute("text"));
	}

	public void RegisterWithAccounts(Class name) throws MalformedURLException  {
		LoggerControler log = this.MyLogger(name);
		AndroidDriver driver = super.SetDriver();
		this.clickMineItem();
		//this.clickRegisterButton();
		this.clickLoginButton();
		this.getName();
	}
}
